/* 合并各个板块的 reducer */
// import {combineReducers} from "redux";
import {combineReducers} from "./myredux-combineReducers"
import {personalReducer} from "./module/personalReducer.js"
import {voteReducer} from "./module/voteReducer.js";
import {taskReducer} from "./module/taskReducer";
import {createStore, applyMiddleware} from "redux";
import reduxLogger from "redux-logger";
import reduxPromise from "redux-promise";
import reduxThunk from "redux-thunk";

console.log(reduxLogger, 11)

const reducer = combineReducers({
    vote: voteReducer,
    personal: personalReducer,
    task:taskReducer
})
const store = createStore(reducer, applyMiddleware(reduxLogger,reduxThunk,reduxPromise))
export default store

// 每一次 dispatch 派发的时候，都会区去每个模块的 reducer 中找一遍，把所有的派发行为匹配的逻辑执行
// 从目前来看，工程化，布局没啥好处，反而让之前的操作更麻烦了